32. TensorFlow Convolutional Layer Workspaces
### Using Convolution Layers in TensorFlow
Let's now apply what we've learned to build real CNNs in TensorFlow. In the below exercise, you'll be asked to set up the dimensions of the Convolution filters, the weights, the biases. This is in many ways the trickiest part to using CNNs in TensorFlow. Once you have a sense of how to set up the dimensions of these attributes, applying CNNs will be far more straight forward.
Review
You should go over the TensorFlow documentation for
2D convolutions
. Most of the documentation is straightforward, except perhaps the
padding
argument. The padding might differ depending on whether you pass
'VALID'
or
'SAME'
.
Here are a few more things worth reviewing:
- Introduction to TensorFlow -> TensorFlow Variables .
-
How to determine the dimensions of the output based on the input size and the filter size (shown below). You'll use this to determine what the size of your filter should be.
new_height = (input_height - filter_height + 2 * P)/S + 1 new_width = (input_width - filter_width + 2 * P)/S + 1
Instructions
-
Finish off each
TODO
in theconv2d
function. -
Setup the
strides
,padding
and filter weight/bias (F_w
andF_b
) such that
the output shape is(1, 2, 2, 3)
. Note that all of these exceptstrides
should be TensorFlow variables.
Workspace
This section contains either a workspace (it can be a Jupyter Notebook workspace or an online code editor work space, etc.) and it cannot be automatically downloaded to be generated here. Please access the classroom with your account and manually download the workspace to your local machine. Note that for some courses, Udacity upload the workspace files onto https://github.com/udacity , so you may be able to download them there.
Workspace Information:
- Default file path:
- Workspace type: jupyter
- Opened files (when workspace is loaded): n/a